from django.conf.urls.defaults import *

# The catalog start page
catalogindex = url(
    regex  = '^$',
    view   = 'catalog.views.catalog_index',
    name   = 'vwcatalogindex'
)

# List of open datasets
catalogopen = url(
    regex  = '^open/$',
    view   = 'catalog.views.catalog_open',
    name   = 'vwcatalogopen'
)

# list of all datasets (maybe set regex to 'all' instead
catalogall = url(
    regex  = '^all/$',
    view   = 'catalog.views.catalog_all',
    name   = 'vwcatalogall'
)

# a single dataset
catalogitem = url(
    regex  = '^(?P<item_id>\d+)/$',
    view   = 'catalog.views.catalog_item',
    name   = 'vwcatalogitem'
)

# a single dataset as RDF/XML
catalogitemrdf = url(
    regex  = '^(?P<item_id>\d+)/rdf/$',
    view   = 'catalog.views.catalog_item_rdf',
    name   = 'vwcatalogitemrdf'
)

# page for an organization
catalogorg = url(
    regex  = '^org/(?P<slug>[a-zA-Z0-9_.-]+)/$',
    view   = 'catalog.views.catalog_org',
    name   = 'vwcatalogorg'
)

# info page about a format
catalogformat = url(
    regex  = '^format/(?P<slug>[a-zA-Z0-9_.-]+)/$',
    view   = 'catalog.views.catalog_format',
    name   = 'vwcatalogformat'
)

# datasets by topic
catalogtopics = url(
    regex  = '^topic/(?P<slug>[a-zA-Z0-9_.-]+)/$',
    view   = 'catalog.views.catalog_topic',
    name   = 'vwcatalogtopic'
)

# the suggest dataset page
catalogsuggest = url(
    regex  = '^suggest/$',
    view   = 'catalog.views.catalog_suggest',
    name   = 'vwcatalogsuggest'
)
urlpatterns = patterns('', catalogopen, catalogall, catalogindex, catalogsuggest, catalogitem, catalogitemrdf, catalogorg, catalogtopics, catalogformat)
